﻿
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace Serives
{
    public  class QuanXianDao
    {
        public async Task<int> Add(Model.QuanXian p)
        {
            int result = 0;
            string sql = $@"insert into dbo.QuanXian( QName, Role) values({p.QName},{p.Role})";
            await Task.Run(() =>
            {
                result = BaseDao.增删改(sql, "QuanXianDao");
            });
            return result;
        }

        public async Task<int> Del(int id)
        {
            int result = 0;
            string sql = $@"delete from dbo.QuanXian where Role={id}";
            await Task.Run(() =>
            {
                result = BaseDao.增删改(sql, "QuanXianDao");
            });
            return result;
        }
       
        
    }
}
